package com.lzz.service.imple;

import com.lzz.dao.PermissionDao;
import com.lzz.entity.Permission;
import com.lzz.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhenzhen
 * @date 2018-12-21 下午9:44
 */
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionDao permissionDao;
    @Override
    public int addPermission(Permission permission) {
        permission.setAvailable(false);
        return permissionDao.insert(permission);

    }

    @Override
    public Permission getById(String uuid) {
        return permissionDao.selectById(uuid);
    }

    @Override
    public List<Permission> getPermissionByRoleId(String roleId) {
        return permissionDao.selectByRoleId(roleId);
    }
}
